<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\xstore\wop\inner\wm\service;

class PoQueryModel {
	
	static $_TSPEC;
	public $wopPoId = null;
	public $systemPoNo = null;
	public $clientPoNo = null;
	public $status = null;
	public $saleArea = null;
	public $warehouseCode = null;
	public $channel = null;
	public $isNeedFaceCount = null;
	public $createdDtmLoc = null;
	public $vendorCode = null;
	public $boxFlag = null;
	public $isBatchStorage = null;
	public $operTime = null;
	public $storageStatus = null;
	public $createdByUser = null;
	public $type = null;
	public $goodsType = null;
	public $deliveryStoreCode = null;
	public $deliveryStoreName = null;
	public $isCrossdock = null;
	public $transactionSource = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'wopPoId'
			),
			2 => array(
			'var' => 'systemPoNo'
			),
			3 => array(
			'var' => 'clientPoNo'
			),
			4 => array(
			'var' => 'status'
			),
			5 => array(
			'var' => 'saleArea'
			),
			6 => array(
			'var' => 'warehouseCode'
			),
			7 => array(
			'var' => 'channel'
			),
			8 => array(
			'var' => 'isNeedFaceCount'
			),
			9 => array(
			'var' => 'createdDtmLoc'
			),
			10 => array(
			'var' => 'vendorCode'
			),
			11 => array(
			'var' => 'boxFlag'
			),
			12 => array(
			'var' => 'isBatchStorage'
			),
			13 => array(
			'var' => 'operTime'
			),
			14 => array(
			'var' => 'storageStatus'
			),
			15 => array(
			'var' => 'createdByUser'
			),
			16 => array(
			'var' => 'type'
			),
			17 => array(
			'var' => 'goodsType'
			),
			18 => array(
			'var' => 'deliveryStoreCode'
			),
			19 => array(
			'var' => 'deliveryStoreName'
			),
			20 => array(
			'var' => 'isCrossdock'
			),
			21 => array(
			'var' => 'transactionSource'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['wopPoId'])){
				
				$this->wopPoId = $vals['wopPoId'];
			}
			
			
			if (isset($vals['systemPoNo'])){
				
				$this->systemPoNo = $vals['systemPoNo'];
			}
			
			
			if (isset($vals['clientPoNo'])){
				
				$this->clientPoNo = $vals['clientPoNo'];
			}
			
			
			if (isset($vals['status'])){
				
				$this->status = $vals['status'];
			}
			
			
			if (isset($vals['saleArea'])){
				
				$this->saleArea = $vals['saleArea'];
			}
			
			
			if (isset($vals['warehouseCode'])){
				
				$this->warehouseCode = $vals['warehouseCode'];
			}
			
			
			if (isset($vals['channel'])){
				
				$this->channel = $vals['channel'];
			}
			
			
			if (isset($vals['isNeedFaceCount'])){
				
				$this->isNeedFaceCount = $vals['isNeedFaceCount'];
			}
			
			
			if (isset($vals['createdDtmLoc'])){
				
				$this->createdDtmLoc = $vals['createdDtmLoc'];
			}
			
			
			if (isset($vals['vendorCode'])){
				
				$this->vendorCode = $vals['vendorCode'];
			}
			
			
			if (isset($vals['boxFlag'])){
				
				$this->boxFlag = $vals['boxFlag'];
			}
			
			
			if (isset($vals['isBatchStorage'])){
				
				$this->isBatchStorage = $vals['isBatchStorage'];
			}
			
			
			if (isset($vals['operTime'])){
				
				$this->operTime = $vals['operTime'];
			}
			
			
			if (isset($vals['storageStatus'])){
				
				$this->storageStatus = $vals['storageStatus'];
			}
			
			
			if (isset($vals['createdByUser'])){
				
				$this->createdByUser = $vals['createdByUser'];
			}
			
			
			if (isset($vals['type'])){
				
				$this->type = $vals['type'];
			}
			
			
			if (isset($vals['goodsType'])){
				
				$this->goodsType = $vals['goodsType'];
			}
			
			
			if (isset($vals['deliveryStoreCode'])){
				
				$this->deliveryStoreCode = $vals['deliveryStoreCode'];
			}
			
			
			if (isset($vals['deliveryStoreName'])){
				
				$this->deliveryStoreName = $vals['deliveryStoreName'];
			}
			
			
			if (isset($vals['isCrossdock'])){
				
				$this->isCrossdock = $vals['isCrossdock'];
			}
			
			
			if (isset($vals['transactionSource'])){
				
				$this->transactionSource = $vals['transactionSource'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'PoQueryModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("wopPoId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->wopPoId); 
				
			}
			
			
			
			
			if ("systemPoNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->systemPoNo);
				
			}
			
			
			
			
			if ("clientPoNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->clientPoNo);
				
			}
			
			
			
			
			if ("status" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->status); 
				
			}
			
			
			
			
			if ("saleArea" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->saleArea);
				
			}
			
			
			
			
			if ("warehouseCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->warehouseCode);
				
			}
			
			
			
			
			if ("channel" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->channel); 
				
			}
			
			
			
			
			if ("isNeedFaceCount" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->isNeedFaceCount); 
				
			}
			
			
			
			
			if ("createdDtmLoc" == $schemeField){
				
				$needSkip = false;
				
				$this->createdDtmLoc = new \com\vip\xstore\wop\inner\common\service\DateRangeModel();
				$this->createdDtmLoc->read($input);
				
			}
			
			
			
			
			if ("vendorCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vendorCode);
				
			}
			
			
			
			
			if ("boxFlag" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->boxFlag); 
				
			}
			
			
			
			
			if ("isBatchStorage" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->isBatchStorage); 
				
			}
			
			
			
			
			if ("operTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->operTime); 
				
			}
			
			
			
			
			if ("storageStatus" == $schemeField){
				
				$needSkip = false;
				$input->readByte($this->storageStatus); 
				
			}
			
			
			
			
			if ("createdByUser" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->createdByUser);
				
			}
			
			
			
			
			if ("type" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->type);
				
			}
			
			
			
			
			if ("goodsType" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->goodsType); 
				
			}
			
			
			
			
			if ("deliveryStoreCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->deliveryStoreCode);
				
			}
			
			
			
			
			if ("deliveryStoreName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->deliveryStoreName);
				
			}
			
			
			
			
			if ("isCrossdock" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->isCrossdock);
				
			}
			
			
			
			
			if ("transactionSource" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->transactionSource);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->wopPoId !== null) {
			
			$xfer += $output->writeFieldBegin('wopPoId');
			$xfer += $output->writeI64($this->wopPoId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->systemPoNo !== null) {
			
			$xfer += $output->writeFieldBegin('systemPoNo');
			$xfer += $output->writeString($this->systemPoNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->clientPoNo !== null) {
			
			$xfer += $output->writeFieldBegin('clientPoNo');
			$xfer += $output->writeString($this->clientPoNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->status !== null) {
			
			$xfer += $output->writeFieldBegin('status');
			$xfer += $output->writeByte($this->status);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->saleArea !== null) {
			
			$xfer += $output->writeFieldBegin('saleArea');
			$xfer += $output->writeString($this->saleArea);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->warehouseCode !== null) {
			
			$xfer += $output->writeFieldBegin('warehouseCode');
			$xfer += $output->writeString($this->warehouseCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->channel !== null) {
			
			$xfer += $output->writeFieldBegin('channel');
			$xfer += $output->writeByte($this->channel);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isNeedFaceCount !== null) {
			
			$xfer += $output->writeFieldBegin('isNeedFaceCount');
			$xfer += $output->writeByte($this->isNeedFaceCount);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->createdDtmLoc !== null) {
			
			$xfer += $output->writeFieldBegin('createdDtmLoc');
			
			if (!is_object($this->createdDtmLoc)) {
				
				throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
			}
			
			$xfer += $this->createdDtmLoc->write($output);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vendorCode !== null) {
			
			$xfer += $output->writeFieldBegin('vendorCode');
			$xfer += $output->writeString($this->vendorCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->boxFlag !== null) {
			
			$xfer += $output->writeFieldBegin('boxFlag');
			$xfer += $output->writeByte($this->boxFlag);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isBatchStorage !== null) {
			
			$xfer += $output->writeFieldBegin('isBatchStorage');
			$xfer += $output->writeByte($this->isBatchStorage);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->operTime !== null) {
			
			$xfer += $output->writeFieldBegin('operTime');
			$xfer += $output->writeI64($this->operTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->storageStatus !== null) {
			
			$xfer += $output->writeFieldBegin('storageStatus');
			$xfer += $output->writeByte($this->storageStatus);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->createdByUser !== null) {
			
			$xfer += $output->writeFieldBegin('createdByUser');
			$xfer += $output->writeString($this->createdByUser);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->type !== null) {
			
			$xfer += $output->writeFieldBegin('type');
			$xfer += $output->writeString($this->type);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->goodsType !== null) {
			
			$xfer += $output->writeFieldBegin('goodsType');
			$xfer += $output->writeI32($this->goodsType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->deliveryStoreCode !== null) {
			
			$xfer += $output->writeFieldBegin('deliveryStoreCode');
			$xfer += $output->writeString($this->deliveryStoreCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->deliveryStoreName !== null) {
			
			$xfer += $output->writeFieldBegin('deliveryStoreName');
			$xfer += $output->writeString($this->deliveryStoreName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isCrossdock !== null) {
			
			$xfer += $output->writeFieldBegin('isCrossdock');
			$xfer += $output->writeString($this->isCrossdock);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->transactionSource !== null) {
			
			$xfer += $output->writeFieldBegin('transactionSource');
			$xfer += $output->writeString($this->transactionSource);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>